<%--
  Created by IntelliJ IDEA.
  User: mac
  Date: 13-1-10
  Time: 下午11:27
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/page/common/jsptag.jsp"%>
<html>
<head>
    <title>用户留言管理</title>
    <link rel="stylesheet" href="<%=request.getContextPath() %>/bg/css/bg.css" type="text/css" />
    <script type="text/javascript" src="../../js/jquery-1.4.4.min.js"></script>
</head>
<body>
    <div id="listDiv">
        <table id="filmTable">
            <col width="3%">
            <col width="10%">
            <col width="30%">
            <col width="15%">
            <col width="5%">
            <thead>
                <tr>
                    <th width="50">ID</th>
                    <th width="100">用户</th>
                    <th>留言内容</th>
                    <th width="200">留言时间</th>
                    <th>控制</th>
                </tr>
            </thead>
            <tbody>
                <c:forEach var="leaveMessage" items="${leaveMessageList}">
                    <tr>
                        <td align="center" style="background-color: #808080;">${leaveMessage.id}</td>
                        <td align="center">${leaveMessage.user.nickName}</td>
                        <td>${leaveMessage.message}</td>
                        <td><fmt:formatDate value="${leaveMessage.createTime}" pattern="yyyy年MM月dd日 HH:mm:ss"/></td>
                        <td align="center">
                            <img src="/images/delete.png"
                                 onclick="javascript:location.href='delLeaveMessage.html?id=${leaveMessage.id}&page=${pageCount.currentPage}';"/>
                        </td>
                    </tr>
                </c:forEach>
            </tbody>
        </table>

        <div id="control">
            <a href="javascript:location.href='leaveMessage.html?page=1'" class="someClass" title="跳转到首页"><<</a>
            <c:choose>
                <c:when test="${pageCount.currentPage == 1}">
                    <a href="javascript:void(0);" style="background-color: #808080;"><</a>
                </c:when>
                <c:otherwise>
                    <a href="javascript:location.href='leaveMessage.html?page=${pageCount.currentPage - 1}'" class="someClass" title="跳转到上一页"><</a>
                </c:otherwise>
            </c:choose>
            <label>${pageCount.currentPage},${pageCount.totalPage} 页</label>
            <c:choose>
                <c:when test="${pageCount.currentPage == pageCount.totalPage}">
                    <a href="javascript:void(0);" style="background-color: #808080;">></a>
                </c:when>
                <c:otherwise>
                    <a href="javascript:location.href='leaveMessage.html?page=${pageCount.currentPage + 1}'" class="someClass" title="跳转到下一页">></a>
                </c:otherwise>
            </c:choose>
            <a href="javascript:location.href='leaveMessage.html?page=${pageCount.totalPage}'" class="someClass" title="跳转到尾页">>></a>
            <div>
                跳转到
                <select onchange="location.href = 'leaveMessage.html?page=' + this.value">
                    <c:forEach var="num" begin="1" end="${pageCount.totalPage}" step="1">
                        <option value="${num}" <c:if test="${pageCount.currentPage == num}">selected</c:if>>${num}页</option>
                    </c:forEach>
                </select>
            </div>
        </div>
    </div>

</body>
</html>